#include "bsp_led.h"

/*
LED1 -- PB11
*/
void BSP_Led_Init(void)
{
	stc_gpio_cfg_t stcGpioCfg;
    
    ///< 打开GPIO外设时钟门控
    Sysctrl_SetPeripheralGate(SysctrlPeripheralGpio, TRUE); 
    
    ///< 端口方向配置->输出 外部三极管驱动led,高电平点亮.
    stcGpioCfg.enDir = GpioDirOut;
    ///< 端口上下拉配置-> none
    stcGpioCfg.enPu = GpioPuEnable;
    stcGpioCfg.enPd = GpioPdDisable;
    stcGpioCfg.enDrv = GpioDrvH;
	stcGpioCfg.enCtrlMode = GpioAHB;
	
    Gpio_Init(GpioPortB, GpioPin11, &stcGpioCfg);
	
	LED_OFF;
	
}


void BSP_led_blink(void)
{	
	M0P_GPIO->PBOUT ^= ((1UL)<<(GpioPin11));
}





